package com.gamelife.test.service;

import com.gamelife.spring.BeanNameAware;
import com.gamelife.spring.InitializingBean;
import com.gamelife.spring.annotation.Autowired;
import com.gamelife.spring.annotation.Component;
import com.gamelife.spring.annotation.Scope;

@Component("userService")
@Scope("prototype")
public class UserServiceImpl implements UserService, InitializingBean, BeanNameAware {

    @Autowired
    private OrderService orderService;

    public void print() {
        System.out.println("orderService注入到UserService");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("initialingBean 的 afterPropertiesSet 方法");
    }

    @Override
    public void setBeanName(String name) {
        System.out.println("BeanNameAware 的 setBeanName 方法");
    }
}
